import Vue from 'vue'
import App from './App.vue'

import router from './router'
import plugins from './plugins'
import store from './store'
import 'normalize.css/normalize.css'
import Element from 'element-ui'
import './styles/element-variables.scss'

import '@/styles/index.scss' // global css
import './icons' // icon
import NProgress from 'nprogress' // progress bar
import 'nprogress/nprogress.css' // progress bar style
import echarts from 'echarts' // 引入echarts
import './mock' // simulation data 模拟数据

Vue.use(Element, {
  size: 'medium' // set element-ui default size
})

Vue.use(plugins)

Vue.config.productionTip = false

Vue.prototype.$echarts = echarts

NProgress.configure({ showSpinner: false }) // NProgress Configuration

// router.beforeEach(async (to, from, next) => {
//   // start progress bar
//   NProgress.start()
//   if (to.meta.title !== undefined) {
//     document.title = to.meta.title
//   } else {
//     document.title = '\u200E'
//   }
//   store.commit('router/initRoutes')
//
//   if (to.path) {
//     // eslint-disable-next-line no-undef
//     _hmt.push(['_trackPageview', '/#' + to.fullPath])
//   }
//
//   next()
// })
//
// router.afterEach(() => {
//   // finish progress bar
//   NProgress.done()
// })

Vue.prototype.$$router = router

new Vue({
  router: router,
  store: store,
  render: (h) => h(App)
}).$mount('#app')
